﻿<%@ Page Language="C#" MasterPageFile="~/YUIAspNet.Master" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="YUIAspNetDemo.SimpleDialog.Default" Title="Untitled Page" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
     <title>YUIAspNet Controls : LiveDemo : SimpleDialog : Usage info</title>
     <script type="text/javascript">
        function ok(sender, args)
        {
            sender.hide();
        }
        
        function alertVal(sender, args)
        {
            var val = $get('tb').value;
            sender.hide();
            
            alert(val);
        }
        
     </script>
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <h1>SimpleDialog usage info</h1>
    
    <p>YUIAsp.Net SimpleDialog can be used as a replacement for the standard javascript functions: alert, confirm and prompt.</p>
    
    <h2>Alert</h2>
    <p>
        <a href="#" onclick="alert('js alert'); return false;">JS Alert</a> | 
        <a href="#" onclick="$find('<%=alert.ClientID %>').show(); return false;">YUIAsp.Net SimpleDialog acting as alert.</a>
    </p>
    
    <yui:SimpleDialog ID="alert" runat="server" Underlay="Shadow" Draggable="true" Width="300px" Icon="Alarm" Header="Alert" Centered="true">
        <Effect Duration="0.3" Effect="Fade" />
        <TextTemplate>YUIAsp.Net alert</TextTemplate>
        <DialogButtonList>
            <yui:DialogButton Text="OK" Handler="ok" />
        </DialogButtonList>
    </yui:SimpleDialog>
    
    <h2>Confirm</h2>
    
    <p>
        <a href="#" onclick="confirm('js alert'); return false;">JS Confirm</a> | 
        <a href="#" onclick="$find('<%= confirm.ClientID %>').show(); return false;">YUIAsp.Net SimpleDialog acting as confirm.</a>
    </p>
    
    <yui:SimpleDialog ID="confirm" runat="server" Underlay="Shadow" Draggable="true" Icon="Alarm" Header="Confirm" Width="400px" Centered="true">
        <Effect Duration="0.3" Effect="Slide" />
        <TextTemplate>YUIAsp.Net confirm. <br /> Are you sure you want to close this dialog?</TextTemplate>
        <DialogButtonList>
            <yui:DialogButton Text="OK" Handler="ok" />
            <yui:DialogButton Text="Cancel" Handler="ok" />
        </DialogButtonList>
    </yui:SimpleDialog>
    
   <h2>Prompt</h2>
    
    <p>
        <a href="#" onclick="prompt('js prompt'); return false;">JS Prompt</a> | 
        <a href="#" onclick="$find('<%=prompt.ClientID %>').show(); return false;">YUIAsp.Net SimpleDialog acting as prompt.</a>
    </p>
    
    <yui:SimpleDialog ID="prompt" runat="server" Underlay="Shadow" Draggable="true" Icon="Alarm" Width="400px" Header="Prompt" Centered="true">
        <Effect Duration="0.3" Effect="Fade" />
        <TextTemplate>
            YUIAsp.Net prompt. Please enter your name:  <br />
            <form name="myform" action="Default.aspx">
            <input type="text" id="tb" name="tb" value="default" />
            </form>
        </TextTemplate>
        <DialogButtonList>
            <yui:DialogButton Text="OK" Handler="alertVal" />
        </DialogButtonList>
    </yui:SimpleDialog>
    
    
</asp:Content>
